import { defineStore } from 'pinia';

export const usegrantStore = defineStore('grant', {
  state: () => ({
    isadmin:null,
    grantlist:null,
  }),
  actions: {
    setisadmin(isadmin) {
      this.isadmin = isadmin;
    },
    setgrantlist(grantlist) {
      this.grantlist = grantlist;
    },
  },
  persist: {
    enabled: true,  // 启用持久化
    strategies: [
      {
        key: 'grant',  // 设置 activetabindex 存储的 key
        storage: localStorage,     // 使用 localStorage 存储
        paths: ['isadmin','grantlist'],  
      },
    ]
  },
});
